package com.edu.scau.service.impl;

import java.util.List;

import com.edu.scau.dao.ICommodityDao;
import com.edu.scau.dao.implement.CommodityDaoImpl;
import com.edu.scau.dao.util.CommodityPage;
import com.edu.scau.dao.util.CreateCommodityPage;
import com.edu.scau.entity.Commodity;
import com.edu.scau.service.ICommodityQueryService;

public class CommodityQueryServiceImpl implements ICommodityQueryService {
	ICommodityDao commodityDao=new CommodityDaoImpl();
	CommodityPage pageUtil=CreateCommodityPage.createPage(10000, 10000, 1);
	
	//==================
	public List<Commodity> queryCommodityAll(CommodityPage page) {
		
		return commodityDao.queryCommodityAll(page);
	}

	public List<Commodity> queryCommodityAll() {
		return commodityDao.queryCommodityAll(pageUtil);
	}

	public int queryNumCommodityAll() {
		return commodityDao.queryNumCommodityAll();
	}
	//============================
	public List<Commodity> queryCommodityByClassification(String classification, CommodityPage page) {
		return commodityDao.queryCommodityByClassification(page, classification);
	}
	/**
	 * 
	 */
	public List<Commodity> queryCommodityByClassification(String classification) {
		return commodityDao.queryCommodityByClassification(pageUtil, classification);
	}

	public int queryNumCommodityByClassification(String classification) {
		return commodityDao.queryNumCommodityByClassification(classification);
	}
	//=============================
	public List<Commodity> queryCommodityById(int id, CommodityPage page) {
		return commodityDao.queryCommodityById(page, id);
	}

	public List<Commodity> queryCommodityById(int id) {
		return commodityDao.queryCommodityById(pageUtil, id);
	}

	
	//==============================
	public List<Commodity> queryCommodityByName(String name, CommodityPage page) {
		return commodityDao.queryCommodityByName(page, name);
	}

	public List<Commodity> queryCommodityByName(String name) {
		return commodityDao.queryCommodityByName(pageUtil, name);
	}

	public int queryNumCommodityByName(String name) {
		return commodityDao.queryNumCommodityByName(name);
	}
	//================================
	public List<Commodity> queryCommodityByPrice(double beginPrice, double endPrice, CommodityPage page) {
		return commodityDao.queryCommodityByPrice(page, beginPrice, endPrice);
	}

	public List<Commodity> queryCommodityByPrice(double beginPrice, double endPrice) {
		return commodityDao.queryCommodityByPrice(pageUtil, beginPrice, endPrice);
	}

	public int queryNumCommodityByPrice(double beginPrice, double endPrice) {
		return commodityDao.queryNumCommodityByPrice(beginPrice, endPrice);
	}
	//===================================
	public List<Commodity> queryCommodityByLikeName(String likeName, CommodityPage page) {
		return commodityDao.queryCommodityByLikeName(page, likeName);
	}

	public List<Commodity> queryCommodityByLikeName(String likeName) {
		return commodityDao.queryCommodityByLikeName(pageUtil, likeName);
	}

	public int queryNumCommodityByLikeName(String likeName) {
		return commodityDao.queryNumCommodityByLikeName(likeName);
	}

	public int queryNumCommodityById(int id) {
		// TODO Auto-generated method stub
		return 0;
	}

}
